package ie.dkit.semanticPhotoWeb.client.dtos;

import java.io.Serializable;

/**
 * @author Sebastian Ruehl
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place, Suite 330, Boston, MA 02111-1307 USA
 */
public class CommentDTO implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4344781823530494727L;

	public String username;

	public String date;

	public String commentContent;

	public String editHref;

	/**
	 * Indicates if a comment is editable otherwise editHref just represent a
	 * selfLink
	 */
	public boolean editable;

	/**
	 * 
	 *
	 */
	public CommentDTO() {
		super();
	}

	/**
	 * Used when the Client sends new comment to the server
	 * 
	 * @param comment
	 *            the comment as String
	 */
	public CommentDTO(String comment) {
		commentContent = comment;
	}

	public CommentDTO(String editHref, String username, String date,
			String commentContent, boolean editable) {
		this.editHref = editHref;
		this.username = username;
		this.date = date;
		this.commentContent = commentContent;
		this.editable = editable;
	}

	public String toString() {
		return username + " wrote at " + date + " :<br />" + commentContent;
	}
}
